package com.zjp.converter;

import com.zjp.domain.Address;
import com.zjp.domain.DeliveryAddressDTO;
import com.zjp.domain.Doctor;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface AddressMapper {

    AddressMapper INSTANCE = Mappers.getMapper(AddressMapper.class);

    @Mapping(source = "doctor.id", target = "personId")
    @Mapping(source = "address.street", target = "streetDesc")
    DeliveryAddressDTO doctorAndAddress2DeliveryAddressDTO(Doctor doctor, Address address);
}